Release 10.1A: OpenEdge Getting Started:
Object-oriented Programming


Defining data in a class file

Data can exist in two basic forms within a class file:

You define data members of a class in the main block of the class file, outside of any method definitions for the class. Like methods, class data members have an access mode that determines the scope of the data member. Thus, private data members are only accessible from within the class where they are defined; protected data members are only accessible from within the class where they are defined and in any subclass of the defining class; and public data members are accessible both within the class hierarchy and from outside the class hierarchy of the instantiated object where they are defined. Thus, only public data members of a given class-based object are accessible from another object or procedure that instantiates the class.

Local variables defined within a method do not have an access mode and are always privately scoped to the method where they are defined. Thus, they are only available within the method during method execution.


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095